tywx.clickStatEventType = {
    clickStatEventTypeUserFrom: 99990001,
    clickStatEventTypeUserShare: 99990002,
    clickStatEventTypeShowAdBtn: 99990003,
    clickStatEventTypeClickShowQRCode: 99990004,
    clickStatEventTypeClickAdBtn: 99990007,
    clickStatEventTypeClickDirectToMiniGameSuccess: 99990005,
    clickStatEventTypeClickDirectToMiniGameFail: 99990006,
    clickStatEventTypeOnShowTimeStampSubmit: 99990010,
    clickStatEventTypeOnHideTimeStampSubmit: 99990011,
    clickStatEventTypeOnReportGameTime: 99990012,
    clickStatEventTypeOnReportShareTimes: 99990013,
    clickStatEventTypeOnReportVideoAdsInfo: 99990020,
    clickStatEventTypeSubmitVersionInfo: 9999,
    clickStatEventTypeWxLoginStart: 10001,
    clickStatEventTypeWxLoginSuccess: 10002,
    clickStatEventTypeWxLoginFailed: 10003,
    clickStatEventTypeAuthorizationStart: 10004,
    clickStatEventTypeAuthorizationSuccess: 10005,
    clickStatEventTypeAuthorizationFailed: 10006,
    clickStatEventTypeLoginSDKStart: 10007,
    clickStatEventTypeLoginSDKSuccess: 10008,
    clickStatEventTypeLoginSDKFailed: 10009,
    clickStatEventTypeTCPStart: 10010,
    clickStatEventTypeTCPSuccess: 10011,
    clickStatEventTypeTCPFailed: 10012,
    clickStatEventType_CREATE_GAME_DATA: 14001,
    clickStatEventType_SCENE_ONLOAD: 14002,
    clickStatEventType_TABLE_START: 14004,
    clickStatEventType_TABLE_END: 14006,
    clickStatEventType_ENTER_ROOM: 14011,
    clickStatEventType_LEAVE_ROOM: 14012,
    clickStatEventType_ENTER_FRI_ROOM: 15001,
    clickStatEventType_LEAVE_FRI_ROOM: 15002,
    clickStatEventType_BIND_USER: 15003,
    clickStatEventType_BIND_USER_SUCCESS: 15004
};
tywx.BiLog = {
    uploadLogTimely: function (e) {
        if (tywx.StateInfo.networkConnected) {
            if (e) {
                var t = {
                    url: tywx.SystemInfo.errorLogServer + "?cloudname=" + tywx.SystemInfo.cloudId + "." + tywx.SystemInfo.intClientId,
                    header: ["Content-Type:text/plain"],
                    postData: e,
                    callback: null
                };
                tywx.HttpUtil.httpPost(t, "POST");
            }
        } else tywx.LOGD("tywx.BiLog", "net error!");
    },
    getSystemInfo: function () {
        this.cloud_id = tywx.SystemInfo.cloudId, this.rec_type = "1", this.rec_id = "0",
            this.receive_time = "0", this.user_id = tywx.UserInfo.userId || "0", this.game_id = tywx.SystemInfo.gameId,
            this.client_id = tywx.SystemInfo.clientId, this.device_id = this.device_id || tywx.Util.getLocalUUID(),
            this.ip_addr = "#IP", this.nettype = "0", this.phone_maker = "0", this.phone_model = tywx.UserInfo.model,
            this.phone_carrier = "0", this.reserved = "0";
    },
    uploadClickStatLogTimely: function (e) {
        if (void 0 != e && "" != e) var t = {
            url: tywx.SystemInfo.biLogServer,
            headers: ["Content-Type:text/plain"],
            postData: e,
            obj: this,
            tag: null,
            callback: null
        };
        tywx.HttpUtil.httpPost(t, "POST");
    },
    clickStat: function (e, t) {
        var n = [];
        if ((t = t || []).length < 10) for (var o = 0; o < 9; o++) o < t.length ? n.push(t[o]) : n.push(0); else n = t;
        tywx.LOGD("BI打点", "eventid= " + e + " 描述 = " + JSON.stringify(n));
        var i = this.assemblelog(e, n);
        this.uploadClickStatLogTimely(i + "\n");
    },
    assemblelog: function (e, t) {
        var n = new Date().getTime();
        n - this._timetag > 6e4 && (this._timetag = n, this.nettype = 0);
        var o = t.join("\t");
        this.getSystemInfo();
        var i = this.cloud_id + "\t" + this.rec_type + "\t" + n + "\t" + this.rec_id + "\t" + this.receive_time + "\t" + e + "\t" + this.user_id + "\t" + this.game_id + "\t" + this.client_id + "\t" + this.device_id + "\t" + this.ip_addr + "\t" + this.nettype + "\t" + this.phone_maker + "\t" + this.phone_model + "\t" + this.phone_carrier + "\t" + o + "\t" + this.reserved;
        return this.trimTab0(i);
    },
    trimTab0: function (e) {
        return null == e || void 0 == e ? "" : e.replace(/(\t0)*$/, "");
    }
}
